package com.kbbywyclient.ui.activity;

import android.view.View;
import android.widget.LinearLayout;

import com.kbbywyclient.R;
import com.kbbywyclient.di.AppComponent;
import com.kbbywyclient.ui.activity.base.BaseActivity;
import com.kbbywyclient.util.ActivitySkipUtil;
import com.kbbywyclient.widget.CustomToolBar;

import java.util.HashMap;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Description:
 * Created by FHW
 * on 2017/5/4
 */

public class InfoCertifySucActivity extends BaseActivity {

    @BindView(R.id.v_toolbar)
    CustomToolBar v_toolbar;
    @BindView(R.id.ll_suc)
    LinearLayout ll_suc;
    @BindView(R.id.ll_certify_ing)
    LinearLayout ll_certify_ing;

    private int activation = -1;
    private int mType = 0;//0-贷款业务 1-信用卡业务
    private boolean isModify = true;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_info_certify_suc;
    }

    @OnClick({R.id.tv_modify})
    void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_modify:
                HashMap<String, Object> map = new HashMap<>();
                map.put("mType", mType);
                map.put("isModify", isModify);
                switch (mType) {
                    case 0://贷款 认证
                        ActivitySkipUtil.skipAnotherActivity(this, InfoCertifyLoanActivity.class, map);
                        finish();
                        break;
                    case 1://信用卡 认证
                        ActivitySkipUtil.skipAnotherActivity(this, InfoCertifyCreditActivity.class, map);
                        finish();
                        break;
                }
                break;
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (activation == 1) {
            setScreenName("资质认证成功");
        } else {
            setScreenName("资质认证提交成功");
        }
    }

    @Override
    protected void initView() {
        activation = getIntent().getIntExtra("activation", -1);
        mType = getIntent().getIntExtra("mType", 0);

        v_toolbar.setLeftViewOnClickLinster(v -> finish());

        if (activation == 1) {
            setScreenName("资质认证成功");
            ll_suc.setVisibility(View.VISIBLE);
            ll_certify_ing.setVisibility(View.GONE);
        } else {
            setScreenName("资质认证提交成功");
            ll_suc.setVisibility(View.GONE);
            ll_certify_ing.setVisibility(View.VISIBLE);
        }

    }

    @Override
    public void initData() {

    }

    @Override
    public void initAppComponent(AppComponent appComponent) {

    }
}
